home *** CD-ROM | disk | FTP | other *** search
- Path: yama.mcc.ac.uk!dmu!usenet
- From: Timothy Eves <se1te@dmu.ac.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Scaling
- Date: Thu, 22 Feb 1996 19:16:24 +0000
- Organization: De Montfort Univerity
- Message-ID: <312CC108.71@dmu.ac.uk>
- References: <1588.6626T1061T1294@sn.no>
- NNTP-Posting-Host: birch.cms.dmu.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/720)
-
- Long time scince I've used the BitMapScale but I think you've missed out
- the bsa_XSrcFactor and bsa_YSrcFactor. Any way there are a set of 2
- pairs of fileds that contoll the scaling ratio. Into the bsa_#SrcFactor
- fileds you put the denominator of you scale ratio. Into the
- bsa_#DestFactor you put the numerator
-
- There for if you want scale a 320x256 bit map to 1/3 along x and 2/5
- along you go:
-
- struct BitScaleArgs bitscale = {0}; // Put all fields to 0.
-
- bitscale.bsa_SrcWidth = Width; // Soruce Width
- bitscale.bsa_SrcHeight = Height; // Source Height
- bitscale.bsa_XSrcFactor = 2; // Scale factor denominator X
- bitscale.bsa_YSrcFactor = 5; // Scale factor denominator Y
- bitscale.bsa_XDestFactor = 1 // Scale factor numerator X
- bitscale.bsa_YDestFactor = 2 // Scale factor numerator Y
- bitscale.bsa_SrcBitMap = BitMap; // Source BitMap
- bitscale.bsa_DestBitMap = newbitmap; // Destination BitMap
-
- BitMapScale(bitscale&);
-
- If you want to enlarge BitMaps just make the fractions top heavy i.e.
- make the numerator bigger than the denominator to to twice the width use
- a ration of 2/1.
-
- If memory serves the bsa_DestWidth/Height fileds contain the size of the
- scaled are after the operation and are filled in by BitMapScale().
-
- If you still have trouble or I've made some mistakes the Mail me and
- I'll send you some source I wrote using BitMapScale() that works.
-
- Tim Eves
- ------------------------------------------------------------O----------------
- Out of the gloom came a voice, "Smile and be happy things| EMail To:
- could be worse", it said. So I smiled and I was happy,|
- se1te@dmu.ac.uk
- and behold things did get worse. |
- ------------------------------------------------------------O----------------
-